import sys
from PyQt5.QtWidgets import (QWidget, QTableWidget, QHBoxLayout, QApplication, QTableWidgetItem,QHeaderView,QAbstractItemView)


class MyTableWidget(QWidget):
    def __init__(self):
        super().__init__()
        self.initUI()

    def initUI(self):

        self.setWindowTitle("单词记忆记录")
        self.resize(350,400)
        conLayout = QHBoxLayout()
        tableWidget = QTableWidget()
        tableWidget.setRowCount(100)
        tableWidget.setColumnCount(3)
        conLayout.addWidget(tableWidget)
        tableWidget.setHorizontalHeaderLabels(['单词', '记忆时间', '下次回顾时间'])


        newItem = QTableWidgetItem("aback")
        tableWidget.setItem(0, 0, newItem)
        newItem = QTableWidgetItem("2021-4-24")
        tableWidget.setItem(0, 1, newItem)
        newItem = QTableWidgetItem("2021-4-25")
        tableWidget.setItem(0, 2, newItem)
        newItem = QTableWidgetItem("abandonment")
        tableWidget.setItem(1, 0, newItem)
        newItem = QTableWidgetItem("2021-4-24")
        tableWidget.setItem(1, 1, newItem)
        newItem = QTableWidgetItem("2021-4-25")
        tableWidget.setItem(1, 2, newItem)
        newItem = QTableWidgetItem("abate")
        tableWidget.setItem(2, 0, newItem)
        newItem = QTableWidgetItem("2021-4-24")
        tableWidget.setItem(2, 1, newItem)
        newItem = QTableWidgetItem("2021-4-25")
        tableWidget.setItem(2, 2, newItem)
        newItem = QTableWidgetItem("abdomen")
        tableWidget.setItem(3, 0, newItem)
        newItem = QTableWidgetItem("2021-4-25")
        tableWidget.setItem(3, 1, newItem)
        newItem = QTableWidgetItem("2021-4-27")
        tableWidget.setItem(3, 2, newItem)
        newItem = QTableWidgetItem("medic")
        tableWidget.setItem(4, 0, newItem)
        newItem = QTableWidgetItem("2021-4-25")
        tableWidget.setItem(4, 1, newItem)
        newItem = QTableWidgetItem("2021-4-27")
        tableWidget.setItem(4, 2, newItem)

        newItem = QTableWidgetItem("paste")
        tableWidget.setItem(5, 0, newItem)
        newItem = QTableWidgetItem("2021-4-25")
        tableWidget.setItem(5, 1, newItem)
        newItem = QTableWidgetItem("2021-4-27")
        tableWidget.setItem(5, 2, newItem)

        newItem = QTableWidgetItem("receptive")
        tableWidget.setItem(6, 0, newItem)
        newItem = QTableWidgetItem("2021-4-25")
        tableWidget.setItem(6, 1, newItem)
        newItem = QTableWidgetItem("2021-4-27")
        tableWidget.setItem(6, 2, newItem)
        self.setLayout(conLayout)

if __name__ == '__main__':
    app = QApplication(sys.argv)
    table = MyTableWidget()
    table.show()
    sys.exit(app.exec_())
